Skip to content

[codex] disable Nagle on Rendezvous WebSockets#30269

Open
richardopenai wants to merge 12 commits into
mainfrom
codex/exec-server-rendezvous-tcp-nodelay
Open

[codex] disable Nagle on Rendezvous WebSockets#30269
richardopenai wants to merge 12 commits into
mainfrom
codex/exec-server-rendezvous-tcp-nodelay

Conversation

@richardopenai

@richardopenai richardopenai commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Disable Nagle unconditionally for both exec-server Rendezvous WebSocket connections.

  • pass disable_nagle=true at the executor and harness connection call sites
  • keep the existing signed URL, protocol, and connection flow unchanged
  • add no feature flag, rollout schema, path variant, or experiment-specific telemetry

The companion internal PR enables TCP_NODELAY on accepted Rendezvous sockets: https://github.com/openai/openai/pull/1082463

Why

Rendezvous carries small, latency-sensitive relay and JSON-RPC frames. Three staging runs of 30 steady-state process/read calls per configuration measured p50 improving from 139.1 ms to 81.5 ms and p95 from 162.0 ms to 95.8 ms with Nagle disabled.

The expected packet overhead is small at the current connection scale. We will use existing latency, error, packet, and CPU monitoring and revert normally if production regresses.

Rollout and rollback

The client and accepted-socket changes can deploy independently. New connections receive the setting as each side deploys. Rollback is a normal code revert; there is no persisted assignment or gate state to unwind.

Validation

  • just test -p codex-exec-server --lib: 164 passed
  • just fix -p codex-exec-server: passed
  • just fmt: passed
  • independent final review found no actionable issue

Copy link
Copy Markdown
Contributor Author

CI diagnosis: the broad Bazel, clippy, release, and argument-comment jobs are failing on the PR base, before reaching this two-line change. The shared error is core/src/session/tests.rs:9187 missing history_mode in CreateThreadParams at current main (5267e805fb). The focused codex-exec-server library suite passed locally (161 tests). I’m keeping the unrelated base repair out of this PR.

@richardopenai richardopenai marked this pull request as ready for review June 26, 2026 18:37
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Review source: Codex Cloud Agents (CCA)

Codex Cloud Agents (CCA) couldn't complete this review. The original Codex Review is unaffected.

connect_async_with_config(
request,
Some(noise_relay_websocket_config()),
/*disable_nagle*/ false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put a pr comment explaining this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendezvous carries small, latency-sensitive relay and JSON-RPC frames. With Nagle enabled, a small write can wait for an ACK or for more data to coalesce, adding delay directly to request/response turns. In three staging runs of 30 steady-state process/read calls per configuration, setting TCP_NODELAY improved p50 from 139.1 ms to 81.5 ms and p95 from 162.0 ms to 95.8 ms.

We are accepting the modest increase in small packets because the current connection volume is low. Existing latency, error, packet, and CPU monitoring will catch regressions, and rollback is a normal code revert. The companion server change applies the same setting to accepted Rendezvous sockets: https://github.com/openai/openai/pull/1082463

@richardopenai richardopenai force-pushed the codex/exec-server-rendezvous-tcp-nodelay branch from 5a1272c to 41213bb Compare June 26, 2026 18:42

@owenlin0 owenlin0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 trust that this is the right thing to do?

@richardopenai richardopenai changed the title [codex] disable Nagle on Rendezvous websockets [codex] gate TCP_NODELAY on Rendezvous transport policy Jun 27, 2026
@richardopenai richardopenai changed the title [codex] gate TCP_NODELAY on Rendezvous transport policy [codex] gate Rendezvous TCP_NODELAY by signed path Jun 27, 2026
@richardopenai richardopenai changed the title [codex] gate Rendezvous TCP_NODELAY by signed path [codex] disable Nagle on Rendezvous WebSockets Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants